package com.boolib.shopweb.web;

import com.boolib.commons.entity.ServerResponse;
import com.boolib.dao.ShopChinaMapper;
import com.boolib.pojo.ShopChina;
import com.boolib.tree.TreeModelHandlerImpl;
import com.boolib.tree.entity.BaseTreeGrid;
import com.boolib.tree.exception.NotFoundItemException;
import org.apache.ibatis.annotations.Select;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.swing.plaf.basic.BasicTreeUI;

@RestController
public class ChinaController {

    @Autowired
    ShopChinaMapper shopChinaMapper;

    @GetMapping("/abc")
    public ServerResponse serverResponse () throws NotFoundItemException {



       TreeModelHandlerImpl<ShopChina> treeModelHandler = new TreeModelHandlerImpl<ShopChina> (shopChinaMapper.selectAll());




        return ServerResponse.createBySuccess( treeModelHandler.findParents(0));
    }

}
